package com.zhangfb95.crosschain.console.command;

import com.zhangfb95.crosschain.console.enums.CommandEnum;
import org.springframework.stereotype.Component;

/**
 * @author zhangfubing
 * @since 2023/12/21
 */
@Component
public class HelpCommand implements Command {

    @Override
    public CommandEnum command() {
        return CommandEnum.HELP;
    }

    @Override
    public boolean handle(String[] args) {
        String helpInfo = """
                ------------------------------------------ Account ------------------------------------------
                add                              Add user with username and password.
                login                            Login with username and password.
                logout                           Logout terminal.
                userinfo                         Show your userinfo.
                updateUsername                   Update your username.
                updatePassword                   Update your password.
                updateSecret                     Update your secret.
                listChainAccount                 List your Universal Account's information.
                addChainAccount                  Add a Chain Account to your user.
                removeChainAccount               Remove a Chain Account from your user.
                addChainAccountProperties        Add properties to your Chain Account.
                removeChainAccountProperties     Remove properties from your Chain Account.

                ------------------------------------ Resource Operation -------------------------------------
                listChainName                    List all chain name including remote chains.
                listChainPath                    List all chain path including remote chains.
                query                            Call constant method of smart contract.
                send                             Call non-constant method of smart contract.
                chainInfo                        Show chain info, including block height.
                blockInfo                        Show block info, including blockNumber/txIds and so on.

                ------------------------------------------ Others -------------------------------------------
                exit                             exit console.
                ---------------------------------------------------------------------------------------------""";
        System.out.println(helpInfo);
        return false;
    }
}
